package com.example.basemvp.base;


import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public abstract class BaseView<P extends BasePresenter, C> extends AppCompatActivity {
    protected P presenter;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init();
        presenter = getPresenter();
        presenter.bindView(this);
    }

    protected abstract void init();


    protected abstract C getContract();

    protected abstract P getPresenter();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        presenter.unBindView();
    }
}
